﻿using System.Drawing;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using YYFDebugTools.ViewWinPages;

namespace YYFDebugTools
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            //StartMoveAnimation();
        }

        private void DropWin(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }


        private void StartMoveAnimation()
        {
            // 创建一个 DoubleAnimation 来控制 Canvas.Left
            DoubleAnimation moveAnimation = new DoubleAnimation
            {
                From = 0,                    // 从左侧开始
                To = 500,                   // 目标位置（根据窗口宽度调整）
                Duration = TimeSpan.FromSeconds(20), // 动画持续时间
                AutoReverse = false,         // 动画不反转
                RepeatBehavior = new RepeatBehavior(1) // 动画执行一次（默认行为）
            };
            Timeline.SetDesiredFrameRate(moveAnimation, 30); // 设置帧速率
            // 对 myRectangle 的 Canvas.Left 应用动画
            this.BeginAnimation(Canvas.LeftProperty, moveAnimation);
        }


        private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {

        }

        private void Image_MouseLeftButtonDown(object sender, MouseEventArgs e)
        {
            //this.BeginAnimation(Canvas.LeftProperty, null);
        }

        private void Image_MouseUp(object sender, MouseButtonEventArgs e)
        {
           
        }

        private void SetImage(object sender, MouseButtonEventArgs e)
        {
            ImageOptions imageOptions=new ImageOptions();
            //imageOptions.Owner = this;
         
            imageOptions.Show();
        }
    }
}